<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>数组</title>
	<link rel="stylesheet" href="">
	<script>
		var arr = [1,5,3,6,9,2]
		arr.sort(function(a,b) {
			return a-b
		})
		console.log(arr)
		arr.sort(function(a,b) {
			return b-a
		})
		console.log(arr)
	</script>
</head>
<body>
	
</body>
</html>